﻿using Basic.FlowCollect;
using Basic.FlowLocalEvent.Model;
using WeDonekRpc.Client.Attr;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowLocalEvent.FlowApp
{
    [LocalEventName("Delete")]
    internal class ClearAppMsg : IEventHandler<FlowAppEvent>
    {
        private IFlowAppMsgTemplateCollect _Service;

        public ClearAppMsg(IFlowAppMsgTemplateCollect service)
        {
            this._Service = service;
        }

        public void HandleEvent(FlowAppEvent data, string eventName)
        {
            _Service.Clear(data.App.Id);
        }
    }
}
